package com.drcoffee.drcoffeemall.service.impl;

import com.drcoffee.drcoffeemall.entry.FirmAlter;
import com.drcoffee.drcoffeemall.mapper.FirmAlterMapper;
import com.drcoffee.drcoffeemall.service.FirmAlterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;

@Service
@Transactional
//@DS("mysql")
public class FirmAlterServiceImpl implements FirmAlterService {

    @Autowired
    FirmAlterMapper firmAlterMapper;

    /*
    * 添加企业变更申请
    * */
    @Override
    public Map<String, Object> addFirmAlter(FirmAlter firmAlter) {
        Map<String, Object> resultMap = new HashMap<>();
        try {
            firmAlterMapper.addFirmAlter(firmAlter);
            resultMap.put("result", true);
            resultMap.put("message", "提交成功");
        } catch (Exception e) {
            resultMap.put("result", false);
            resultMap.put("message", "提交失败");
            resultMap.put("error", e.toString());
            e.printStackTrace();
        }
        return resultMap;
    }
}
